package cn.compose.online.vo;

import cn.compose.online.enums.ResultTypeEnum;
import lombok.Data;

import java.io.Serializable;

/**
 * author: haiyangp
 * date:  2017/9/26
 * desc: 响应结果
 */
@Data
public class ResultResponse implements Serializable {
    //执行结果
    private String executeResult;
    //状态类型
    private ResultTypeEnum resultTypeEnum;
    //执行时间
    private Long executeDurationTime=-1l;

    private String message;


    public static ResultResponse Build(ResultTypeEnum resultTypeEnum) {
        ResultResponse resultResponse = new ResultResponse();
        resultResponse.setResultTypeEnum(resultTypeEnum);
        return resultResponse;
    }

    public static ResultResponse Build(ResultTypeEnum resultTypeEnum, String message) {
        ResultResponse resultResponse = Build(resultTypeEnum);
        resultResponse.setMessage(message);
        return resultResponse;
    }
}
